package com.synergy.stockflow.production.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.synergy.stockflow.procure.entity.PurchaseDetails;
import com.synergy.stockflow.sales.entity.Quotation;
import io.swagger.v3.oas.annotations.media.Schema;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Schema
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "production_plan")
public class ProductionPlan {
    /**
     * 计划ID
     *
     */
    @TableId(value = "plan_id", type = IdType.ASSIGN_ID)
    @Schema(description="计划ID")
    private String planId;

    /**
     * 计划编号(格式:PP-202407001)
     */
    @TableField(value = "plan_code")
    @Schema(description="计划编号(格式:PP-202407001)")
    private String planCode;

    /**
     * 销售订单ID
     */
    @TableField(value = "sales_order_id")
    @Schema(description="销售订单ID")
    private String salesOrderId;

    /**
     * 计划名称
     */
    @TableField(value = "plan_name")
    @Schema(description="计划名称")
    private String planName;

    /**
     * 计划类型(1=订单计划,2=库存计划)
     */
    @TableField(value = "plan_type")
    @Schema(description="计划类型(1=订单计划,2=库存计划)")
    private Integer planType;

    /**
     * 计划状态(0=待计划,1=已计划,2=已完结)
     */
    @TableField(value = "plan_status")
    @Schema(description="计划状态(0=待计划,1=已计划,2=已完结)")
    private Integer planStatus;

    /**
     * 计划开始时间
     */
    @TableField(value = "start_date")
    @Schema(description="计划开始时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date startDate;

    /**
     * 计划结束时间
     */
    @TableField(value = "end_date")
    @Schema(description="计划结束时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date endDate;

    /**
     * 负责人ID
     */
    @TableField(value = "manager_id")
    @Schema(description="负责人ID")
    private String managerId;

    /**
     * 实际完成时间
     */
    @TableField(value = "actual_finish_time")
    @Schema(description="实际完成时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date actualFinishTime;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    @Schema(description="创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date createTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_time")
    @Schema(description="更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date updateTime;


    @TableField(exist = false)
    @Schema(description="生产计划详情")
    private ProductionPlanDetail productionPlanDetails;

    @TableField(exist = false)
    @Schema(description="生产任务")
    private List<ProductionTask> productionTasks;

    @TableField(exist = false)
    private String materialId;

    @TableField(exist = false)
    private String materialName;

    @TableField(exist = false)
    private String specificationsAndModels;

    @TableField(exist = false)
    private String unit;

    @TableField(exist = false)
    private BigDecimal planQuantity;

}